<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />

        <!-- blueprint CSS framework -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
        <!--[if lt IE 8]>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
        <![endif]-->

        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
        <?php Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/jqueryslidemenu.css'); ?>
        <?php Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . '/css/ui-darkness/jquery-ui.css'); ?>

        <!-- JavaScript -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/scripts/jquery-ui.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/scripts/jqueryslidemenu.js'); ?>
        <?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/scripts/all.js'); ?>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>

    </head>

    <body>

        <div class="container" id="page">

            <div id="header">
                <div id="logo"></div>
            </div><!-- header -->
            <div id="menu">
                <div id="myslidemenu" class="jqueryslidemenu" style="margin: 0 auto; width: 700px">
                    <?php
                    $this->widget('zii.widgets.CMenu', array(
                        'activeCssClass' => 'active',
                        'activateParents' => true,
                        'items' => array(
                            array('label' => 'Home', 'url' => array('/site/index', 'c' => 'recent')),
                            array('label' => 'Poczekalnia', 'url' => array('/site/index', 'c' => 'waiting')),
                            array('label' => 'Top Lista', 'url' => array('/site/index', 'c' => 'top')),
                            array('label' => 'Contact', 'url' => array('/site/contact')),
                            array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest),
                            array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest),
                            array('label' => 'Admin Panel', 'url' => array('/admin/index'), 'visible' => (Yii::app()->user->checkAccess('admin') || Yii::app()->user->checkAccess('moderator')), 'items' => array(
                                    array('label' => 'Add user', 'url' => array('/admin/users/create')),
                                    array('label' => 'Manage users', 'url' => array('/admin/users/admin')),
                                    array('label' => 'Add content', 'url' => array('/content/addcontent')),
                                    array('label' => 'Manage content', 'url' => array('/content/admin')),
                                    array('label' => 'Content approval and moderation', 'url' => array('/content/index', 'c' => 'moderate')),
                            ))
                        ),
                    ));
                    ?>
                </div>
            </div>

            <div style="clear: both;"></div>
            <!-- mainmenu -->

            <div id="content-container">
                <div id="content">
                    <?php if (isset($this->breadcrumbs)): ?>
                        <?php
                        $this->widget('zii.widgets.CBreadcrumbs', array(
                            'links' => $this->breadcrumbs,
                        ));
                        ?><!-- breadcrumbs -->
                    <?php endif ?>

                    <?php
                    foreach (Yii::app()->user->getFlashes() as $key => $message) {
                        echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
                    }
                    ?>
                    <?php echo $content; ?>
                </div>
                <div style="clear: both;"></div>
            </div>
            <div id="footer">
                Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
                All Rights Reserved.<br/>
                <?php echo Yii::powered(); ?>
            </div><!-- footer -->

        </div><!-- page -->

    </body>
</html>